// dart 中的泛型

class Product {
  var pid, pname, price;

  Product(this.pid, this.pname, this.price);

  @override
  String toString() {
    return "Product { pid: $pid, pname: $pname, price: $price }";
  }
}

void main() {
  var strs = <String> ["张三", "李四", "王五"];
  strs.add("田七");
  print(strs);

  var nums = <num> [1, 2, 3, 4, 5];
  nums.add(6);
  print(nums);

  var products = <Product> [
    Product(1, "iPhone15 Pro Max", 6999),
    Product(2, "iPhone 15 Pro", 5999),
    Product(3, "iPhone 15", 5499)
  ];
  products.add(Product(4, "华为Mate60 pro", 8999));
  print(products);
}
